package NGUYENHUUDUC.OOP.EXCLASS1;

public class MODELS {
	String KQ = "";
	public String PTBH (double a,double b,double c){
		String out = "";
		double delta;
		delta = Math.pow(b, 2)-4*a*c;
		if(delta<0){
			out="Phuong trinh vo nghiem";
		}else if(delta==0){
			double x;
			x=-b/2*a;
			out="Phuong trinh co nghiem kep"+x;
		}else {
			double x1=-b+Math.sqrt(delta)/2*a;
			double x2=-b-Math.sqrt(delta)/2*a;
			out="Phuong trinh co 2 nghiem phan biet"+x1+","+x2;
		}
		return out;		
	}	
}
